#!/bin/sh
volume() {
  sstate="$(sndioctl -n output.mute)"
  test $sstate -eq 1 && { printf '%s' "婢"; exit; }
  vol="$(sndioctl -n output.level | cut -c 3,4)"
  case "$((
    vol >= 70 ? 1 :
    vol <= 30 ? 2 : 3
  ))" in
    1) icon=""  ;;
    2) icon="奄" ;;
    3) icon=""  ;;
  esac
  printf '%s %s%%' "$icon" $vol
}
